package cn.lg.soar.message.event;

import cn.lg.soar.message.api.enums.WebSocketEventTypeEnum;
import lombok.Getter;
import lombok.ToString;
import org.springframework.context.ApplicationEvent;

import java.time.Clock;

/**
 * websocket事件
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ToString
@Getter
public class WebSocketEvent extends ApplicationEvent {

    protected final WebSocketEventTypeEnum type;

    protected final String clientId;

    public WebSocketEvent(WebSocketEventTypeEnum type, String clientId, Object source) {
        super(source);
        this.type = type;
        this.clientId = clientId;
    }

    public WebSocketEvent(WebSocketEventTypeEnum type, String clientId, Object source, Clock clock) {
        super(source, clock);
        this.type = type;
        this.clientId = clientId;
    }

}
